if yum update; then
    yum install pcre-devel openssl-devel -y
fi
if apt update; then
    apt install libssl-dev libpcre3-dev zlib1g-dev make gcc  libz-dev -y 
fi
# apt install libpcre3-dev libssl-dev 
wget https://openresty.org/download/openresty-1.21.4.1.tar.gz
tar xf openresty-1.21.4.1.tar.gz
cd openresty-1.21.4.1
echo '#define NGINX_VER          "Apache/2" ' >> bundle/nginx-1.21.4/src/core/nginx.h
./configure --prefix=/usr/local/nginx --with-http_v2_module
make install

ln -s /usr/local/nginx/nginx/sbin/nginx /usr/local/bin/
rm -rf /usr/local/nginx/nginx/html/*

wget https://gitee.com/pandora/install/raw/master/nginx.service -O /usr/local/nginx/nginx.service
systemctl enable  /usr/local/nginx/nginx.service
systemctl start nginx

# macOS
# ./configure --prefix=/usr/local/nginx --with-http_v2_module --with-pcre=/opt/homebrew/Cellar/pcre2/10.39/ --with-openssl=/opt/homebrew/Cellar/openssl\@3/3.0.2/
